#ifndef __PLAYER_H__
#define __PLAYER_H__

#include "cocos2d.h"
#include "HpBar.h"

USING_NS_CC;
using namespace std;

class Player :public Sprite
{
public:
    enum PlayerType { PLAYER, ENEMY };
    enum PlayerAnimationType { STANDBY, MOVE, ATTACK, DEAD, UNDERATTACK, JUMPBACK };

    bool initWithPlayerType(PlayerType playerType);
    static Player* create(PlayerType playerType);
    void addAnimation();
    void playAnimationForever(PlayerAnimationType animationType);
    void walkTo(Vec2 dest);
    bool isEnemy() {
        if(_type != PlayerType::PLAYER) {
            return true;
        }
        return false;
    }
	PlayerType getPlayerType()
	{
		return _type;
	}
	void setCanAttack(bool canAttack)
	{
		_isCanAttack = canAttack;
	}

	bool isCanAttack()
	{
		return _isCanAttack;
	}



private:
	bool _isCanAttack;
    PlayerType _type;
    string _name;
    int _aniCount;
    vector<int> _aniFrameNum;
    vector<string> _aniNames;
    float _speed;
    Sequence* _seq;
    HpBar* _hpBar;
};
#endif